package com.swy.shopgroup.service.impl;


import com.swy.shopgroup.ResultUtils;
import com.swy.shopgroup.dao.GoodsMapper;
import com.swy.shopgroup.dao.ShopInfoMapper;
import com.swy.shopgroup.entity.Goods;
import com.swy.shopgroup.entity.Result;
import com.swy.shopgroup.entity.ShopInfo;
import com.swy.shopgroup.service.GoodsService;
import com.swy.shopgroup.service.ShopService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
public class GoodsServiceImpl implements GoodsService {

    @Resource
    GoodsMapper goodsMapper;

    @Override
    public Result insertGoods(Goods goods) {
        return ResultUtils.success("创建成功",goodsMapper.insert(goods));
    }

    @Override
    public Result selectByShop(Long id) {
        return ResultUtils.success("查询成功",goodsMapper.selectByShop(id));
    }

    @Override
    public Result selectByState() {
        return ResultUtils.success("查询成功",goodsMapper.selectAll());
    }
}
